<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta charset="UTF-8">
		<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/css/base.css">
		<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/css/css/style.css">
		<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-2.1.4.min.js"></script>
		<title>订单管理-我的订单-交易成功</title>
	</head>
	<body>
		<div class="page">
			<div class="header">
				<div class="header_top"></div>
				<div class="header_bottom clearfix">
					<div class="header_logo fl">
						<img src="${pageContext.request.contextPath}/images/images/index-logo.png">
					</div>
					<ul class="header_nav clearfix fl">
						<li>
							<a href="${pageContext.request.contextPath}/morder/waitOrderList.html" class="on">订单管理</a>
						</li>
						<li>
							<a href="${pageContext.request.contextPath}/staff/queryAllList/1.html">家政人员管理</a>
						</li>
						<li>
							<a href="${pageContext.request.contextPath}/supplier/account.html">财务管理</a>
						</li>
						<li>
							<a href="${pageContext.request.contextPath}/admin/accountInfo.html" >账户管理</a>
						</li>
					</ul>
					<div class="header_user fr">
						<img src="${pageContext.request.contextPath}/images/images/user.png">欢迎您，<i>${ sessionScope.MANAGER_NAME} </i><a href="${pageContext.request.contextPath}/manager/loginout.html">【切换账号】</a>
					</div>
				</div>
			</div>
			<div class="main clearfix">
				<div class="main_menu fl">
					<div class="menu_name ">
						<a href="${pageContext.request.contextPath}/morder/waitOrderList.html">
							<img src="${pageContext.request.contextPath}/images/images/ddc.png">
							<p>订单池</p>
						</a>
					</div>
					<div class="menu_name">
						<a href="${pageContext.request.contextPath}/need/waitNeedList/1.html">
							<img src="${pageContext.request.contextPath}/images/images/xqc.png">
							<p>需求池</p>
						</a>
					</div>
					<div class="menu_name on">
						<a href="${pageContext.request.contextPath}/morder/assignList/1.html">
							<img src="${pageContext.request.contextPath}/images/images/wddd.png">
							<p>我的订单</p>
						</a>
					</div>
				
				</div>
				<div class="main_cont fl">
					<div class="main_cont_top">
						<div class="main_inner clearfix">
							<div class="cont_top_title fl">当前位置：订单管理 > 我的订单 > 交易成功</div>
							<div class="cont_top_time fr"><i><img src="${pageContext.request.contextPath}/images/images/refresh.png">
							<a href="${pageContext.request.contextPath}/morder/successList/1.html">刷新</a>
							</i></div>
						</div>
					</div>
					<div class="main_cont_top">
						<div class="main_inner clearfix">
							<!--  <div class="cont_top_title fl">我的嘿币：<i>0</i> 元</div>-->
							<div class="cont_top_time fr">
								<!-- <select>  
									<option value ="全部订单">全部订单</option>
								</select> -->
								<form action="${pageContext.request.contextPath}/morder/successList/1.html" id="youform">
								下单时间：<input class="Wdate" type="text" onClick="WdatePicker()" name="starts">  到 
								 <input class="Wdate" type="text" onClick="WdatePicker()" name="ends">
								 <input type="submit" value="订单搜索" class="search">
								 </form>
							</div>
						</div>
					</div>
					<div class="main_cont_bottom_dys">
						<div class="main_inner">
							<ul class="main_cont_title clearfix">
								<li>
									<a href="${pageContext.request.contextPath}/morder/assignList/1.html" >待分配</a>
								</li>
								
								<li>
									<a href="${pageContext.request.contextPath}/morder/assignedList/1.html" >已分配</a>
								</li>
								<li>
									<a href="${pageContext.request.contextPath}/morder/inspectList/1.html">待验收</a>
								</li>
								<li>
									<a href="${pageContext.request.contextPath}/morder/successList/1.html" class="on">交易成功</a>
								</li>
								<li>
									<a href="${pageContext.request.contextPath}/morder/failList/1.html">交易失败</a>
								</li>
								<li>
									<a href="${pageContext.request.contextPath}/need/waitNeedList/1.html?flag=1" >我的需求</a>
								</li>
							</ul>
							<table class="table table-border table-bordered table-hover table-bg table-sort">
							    <thead>
							    <tr> 
							        <th><input type="checkbox" checked="checked" class="checked"></th>
							        <th>订单编号</th> 
							        <th>订单类型</th>
							        <th>服务地址</th>
							        <th>服务开始时间</th>
							        <th>服务时长</th>
							        <th>服务人数</th>
							       <!--  <th>服务人员</th> -->
							        <th>订单费用</th> 
							        <!-- <th>是否入账</th> -->
							        <th>操作</th>
							    </tr>
							    </thead> 
							    <tbody>
							     <c:forEach items="${PAGE_BEAN.dataList}" var="order">
									<tr class="text-c">
										<td><input type="checkbox" checked="checked" class="checked"></td>
										<td><c:out value="${order.wOOrderNo}"/></td>
										<td><c:out value="${order.wOServiceName}"/></td>
										<td><c:out value="${order.orderDetailDO.wOAddress}"/></td>
										<td> <fmt:formatDate value="${order.orderDetailDO.wOSubscribe}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
										<td><c:out value="${order.orderDetailDO.wOServerTime}"/></td>
										<td><c:out value="${order.orderDetailDO.wOStaffCount}"/></td>
										<%-- <td><c:out value="${order.staffIds}"/></td> --%>
										<td><c:out value="${order.wOFee}"/></td>
										<%-- <td><c:out value="${order.orderDetailDO.wOIsPay}"/></td> --%>
										<td class="td-manage">
											<button id="orderDetail" onclick="showdetail(${order.id});" >查看详情</button>
										</td>
									</tr>
								</c:forEach>
							    </tbody>
							    
							</table>
							<%@ include file="/WEB-INF/views/page.jsp"%>
						</div>
					</div>
				</div>
			</div>
			<!--查看详情-->
			<div class="mask_ddxq">
				<div class="ckddxq">
					<img src="${pageContext.request.contextPath}/images/images/close.png" class="close" onclick="qxddxq();">
					<h3>订单详情</h3>
					<ul id="detail">
						<!-- <li>订单编号：201687876565456</li>
						<li>订单类型：临时保洁</li>
						<li>订单费用：120.00元</li>
						<li>客户电话：15273636765</li>
						<li>客户姓名：唐经晶</li>
						<li>服务地址：重庆市九龙坡区佳馨花园 3-5-2</li>
						<li>订单状态：待分配</li> -->
					</ul>
				</div>
			</div>
		</div>
		
		<script type="text/javascript" src="${pageContext.request.contextPath}/lib/layer/2.1/layer.js"></script>
		<script type="text/javascript" src="${pageContext.request.contextPath}/lib/laypage/1.2/laypage.js"></script> 
		<script type="text/javascript" src="${pageContext.request.contextPath}/lib/My97DatePicker/WdatePicker.js"></script> 
		<script type="text/javascript" src="${pageContext.request.contextPath}/lib/datatables/1.10.0/jquery.dataTables.min.js"></script> 
				<script>
				$(function(){
					$('.table-sort').dataTable({
						"bLengthChange": false, //改变每页显示数据数量
						"aaSorting": [[ 1, "desc" ]],//默认第几个排序
						"bStateSave": true,//状态保存
						"bPaginate" : false,// 分页按钮  
						"aoColumnDefs": [
						  //{"bVisible": false, "aTargets": [ 3 ]} //控制列的隐藏显示
						  {"orderable":false,"aTargets":[0,3,3]}// 制定列不参与排序
						]
					});
				});
				
				function showdetail(id){
					  $.ajax({
						  url: "${pageContext.request.contextPath}/morder/detail2/"+id+".json",
						  success:function(data) {
								  var list=data.list;
								  $("#detail").html("");
								  $("#detail").append("<li>订单编号："+list[0].wOOrderNo+"</li>");
								  $("#detail").append("<li>订单类型："+list[0].wOServiceName+"</li>");
								  $("#detail").append("<li>订单费用："+list[0].wOFee+"</li>");  
								  if(list[0].orderDetailDO!=null){
									  $("#detail").append("<li>客户电话："+list[0].orderDetailDO.wOTelephone+"</li>");
									  $("#detail").append("<li>客户姓名："+list[0].orderDetailDO.wOContact+"</li>");
									  $("#detail").append("<li>服务地址："+list[0].orderDetailDO.wOAddress+"</li>");
								  }
								  var str="";
								  if(list[0].status==6){
									  str="交易成功";
								  }
								  $("#detail").append("<li>订单状态："+str+"</li>"); 
								 // $("#detail").append("<li>订单状态："+list[0].status+"</li>");  
								  $(".mask_ddxq").show(); 
						  }
					});   
				}
				
				function qxddxq(){
					$(".mask_ddxq").hide();
				}
				
				</script>
	</body>
</html>
